/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author elfatah
 */
@Entity
@Table(name = "jenis_barang")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "JenisBarang.findAll", query = "SELECT j FROM JenisBarang j"),
    @NamedQuery(name = "JenisBarang.findByJenisId", query = "SELECT j FROM JenisBarang j WHERE j.jenisId = :jenisId"),
    @NamedQuery(name = "JenisBarang.findByNama", query = "SELECT j FROM JenisBarang j WHERE j.nama = :nama")})
public class JenisBarang implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "JENIS_ID")
    private Integer jenisId;
    @Column(name = "NAMA")
    private String nama;

    public JenisBarang() {
    }

    public JenisBarang(Integer jenisId) {
        this.jenisId = jenisId;
    }

    public Integer getJenisId() {
        return jenisId;
    }

    public void setJenisId(Integer jenisId) {
        this.jenisId = jenisId;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (jenisId != null ? jenisId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JenisBarang)) {
            return false;
        }
        JenisBarang other = (JenisBarang) object;
        if ((this.jenisId == null && other.jenisId != null) || (this.jenisId != null && !this.jenisId.equals(other.jenisId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.JenisBarang[ jenisId=" + jenisId + " ]";
    }
    
}
